-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Explicitly set VideoTexture#colorSpace to SRGBColorSpace
#31534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
colorSpace to SRGBColorSpace for the new apporachVideoTexture#colorSpace to SRGBColorSpace
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
Yes, a warning that informs about an invalid color space is surely helpful. |
|
@ycw Are you interested in giving this a try? A possible place for a check is below when the texture is initialized for the first time: three.js/src/renderers/common/Textures.js Lines 320 to 323 in 54ac263
Although @sunag might recommend an alternative place. |
If the idea is to align with both backends it would be a good place. |
Related: #31416, Discussion: #31533
Due to inherent design constraints in WebGPURenderer,
VideoTexture#colorSpacemust be explicitly set to SRGBColorSpace. Assigning alternative values may result in perceptible color inaccuracies, including luminance shifts and hue distortion. This outcome is a direct consequence of the renderer's internal texture handling mechanisms (i.e. copyExternalImageToTexture with destination.colorSpace:'srgb') and is entirely independent of the color space employed by the browser during video decoding.